# **********************************************************************
#
# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved.
#
# This copy of Ice is licensed to you under the terms described in the
# ICE_LICENSE file included in this distribution.
#
# **********************************************************************

# Ice version 3.3.1
# Generated from file `Video.ice'

import Ice, IcePy, __builtin__

if not Ice.__dict__.has_key("_struct_marker"):
    Ice._struct_marker = object()
import TeRKCommon_ice

# Included module Ice
_M_Ice = Ice.openModule('Ice')

# Included module Glacier2
_M_Glacier2 = Ice.openModule('Glacier2')

# Included module peer
_M_peer = Ice.openModule('peer')

# Included module TeRK
_M_TeRK = Ice.openModule('TeRK')

# Start of module TeRK
__name__ = 'TeRK'

if not _M_TeRK.__dict__.has_key('ImageFormat'):
    _M_TeRK.ImageFormat = Ice.createTempClass()
    class ImageFormat(object):

        def __init__(self, val):
            assert(val >= 0 and val < 6)
            self.value = val

        def __str__(self):
            if self.value == 0:
                return 'ImageJPEG'
            elif self.value == 1:
                return 'ImageRGB24'
            elif self.value == 2:
                return 'ImageRGB32'
            elif self.value == 3:
                return 'ImageGray8'
            elif self.value == 4:
                return 'ImageYUV420P'
            elif self.value == 5:
                return 'ImageUnknown'
            return None

        __repr__ = __str__

        def __hash__(self):
            return self.value

        def __cmp__(self, other):
            return cmp(self.value, other.value)

    ImageFormat.ImageJPEG = ImageFormat(0)
    ImageFormat.ImageRGB24 = ImageFormat(1)
    ImageFormat.ImageRGB32 = ImageFormat(2)
    ImageFormat.ImageGray8 = ImageFormat(3)
    ImageFormat.ImageYUV420P = ImageFormat(4)
    ImageFormat.ImageUnknown = ImageFormat(5)

    _M_TeRK._t_ImageFormat = IcePy.defineEnum('::TeRK::ImageFormat', ImageFormat, (), (ImageFormat.ImageJPEG, ImageFormat.ImageRGB24, ImageFormat.ImageRGB32, ImageFormat.ImageGray8, ImageFormat.ImageYUV420P, ImageFormat.ImageUnknown))

    _M_TeRK.ImageFormat = ImageFormat
    del ImageFormat

if not _M_TeRK.__dict__.has_key('VideoException'):
    _M_TeRK.VideoException = Ice.createTempClass()
    class VideoException(_M_TeRK.TeRKException):
        def __init__(self, reason=''):
            _M_TeRK.TeRKException.__init__(self, reason)

        def ice_name(self):
            return 'TeRK::VideoException'

        def __str__(self):
            return IcePy.stringifyException(self)

        __repr__ = __str__

    _M_TeRK._t_VideoException = IcePy.defineException('::TeRK::VideoException', VideoException, (), _M_TeRK._t_TeRKException, ())
    VideoException.ice_type = _M_TeRK._t_VideoException

    _M_TeRK.VideoException = VideoException
    del VideoException

if not _M_TeRK.__dict__.has_key('Image'):
    _M_TeRK.Image = Ice.createTempClass()
    class Image(object):
        def __init__(self, height=0, width=0, frameNum=0, format=_M_TeRK.ImageFormat.ImageJPEG, data=None):
            self.height = height
            self.width = width
            self.frameNum = frameNum
            self.format = format
            self.data = data

        def __hash__(self):
            _h = 0
            _h = 5 * _h + __builtin__.hash(self.height)
            _h = 5 * _h + __builtin__.hash(self.width)
            _h = 5 * _h + __builtin__.hash(self.frameNum)
            _h = 5 * _h + __builtin__.hash(self.format)
            if self.data:
                for _i0 in self.data:
                    _h = 5 * _h + __builtin__.hash(_i0)
            return _h % 0x7fffffff

        def __cmp__(self, other):
            if other == None:
                return 1
            if self.height < other.height:
                return -1
            elif self.height > other.height:
                return 1
            if self.width < other.width:
                return -1
            elif self.width > other.width:
                return 1
            if self.frameNum < other.frameNum:
                return -1
            elif self.frameNum > other.frameNum:
                return 1
            if self.format < other.format:
                return -1
            elif self.format > other.format:
                return 1
            if self.data < other.data:
                return -1
            elif self.data > other.data:
                return 1
            return 0

        def __str__(self):
            return IcePy.stringify(self, _M_TeRK._t_Image)

        __repr__ = __str__

    _M_TeRK._t_Image = IcePy.defineStruct('::TeRK::Image', Image, (), (
        ('height', (), IcePy._t_int),
        ('width', (), IcePy._t_int),
        ('frameNum', (), IcePy._t_int),
        ('format', (), _M_TeRK._t_ImageFormat),
        ('data', (), _M_TeRK._t_ByteArray)
    ))

    _M_TeRK.Image = Image
    del Image

if not _M_TeRK.__dict__.has_key('VideoStreamerClient'):
    _M_TeRK.VideoStreamerClient = Ice.createTempClass()
    class VideoStreamerClient(Ice.Object):
        def __init__(self):
            if __builtin__.type(self) == _M_TeRK.VideoStreamerClient:
                raise RuntimeError('TeRK.VideoStreamerClient is an abstract class')

        def ice_ids(self, current=None):
            return ('::Ice::Object', '::TeRK::VideoStreamerClient')

        def ice_id(self, current=None):
            return '::TeRK::VideoStreamerClient'

        def ice_staticId():
            return '::TeRK::VideoStreamerClient'
        ice_staticId = staticmethod(ice_staticId)

        #
        # Operation signatures.
        #
        # def newFrame(self, frame, current=None):

        def __str__(self):
            return IcePy.stringify(self, _M_TeRK._t_VideoStreamerClient)

        __repr__ = __str__

    _M_TeRK.VideoStreamerClientPrx = Ice.createTempClass()
    class VideoStreamerClientPrx(Ice.ObjectPrx):

        def newFrame(self, frame, _ctx=None):
            return _M_TeRK.VideoStreamerClient._op_newFrame.invoke(self, ((frame, ), _ctx))

        def checkedCast(proxy, facetOrCtx=None, _ctx=None):
            return _M_TeRK.VideoStreamerClientPrx.ice_checkedCast(proxy, '::TeRK::VideoStreamerClient', facetOrCtx, _ctx)
        checkedCast = staticmethod(checkedCast)

        def uncheckedCast(proxy, facet=None):
            return _M_TeRK.VideoStreamerClientPrx.ice_uncheckedCast(proxy, facet)
        uncheckedCast = staticmethod(uncheckedCast)

    _M_TeRK._t_VideoStreamerClientPrx = IcePy.defineProxy('::TeRK::VideoStreamerClient', VideoStreamerClientPrx)

    _M_TeRK._t_VideoStreamerClient = IcePy.defineClass('::TeRK::VideoStreamerClient', VideoStreamerClient, (), True, None, (), ())
    VideoStreamerClient.ice_type = _M_TeRK._t_VideoStreamerClient

    VideoStreamerClient._op_newFrame = IcePy.Operation('newFrame', Ice.OperationMode.Normal, Ice.OperationMode.Normal, False, (), (((), _M_TeRK._t_Image),), (), None, ())

    _M_TeRK.VideoStreamerClient = VideoStreamerClient
    del VideoStreamerClient

    _M_TeRK.VideoStreamerClientPrx = VideoStreamerClientPrx
    del VideoStreamerClientPrx

if not _M_TeRK.__dict__.has_key('VideoStreamerServer'):
    _M_TeRK.VideoStreamerServer = Ice.createTempClass()
    class VideoStreamerServer(_M_TeRK.AbstractCommandController):
        def __init__(self):
            if __builtin__.type(self) == _M_TeRK.VideoStreamerServer:
                raise RuntimeError('TeRK.VideoStreamerServer is an abstract class')

        def ice_ids(self, current=None):
            return ('::Ice::Object', '::TeRK::AbstractCommandController', '::TeRK::PropertyManager', '::TeRK::VideoStreamerServer')

        def ice_id(self, current=None):
            return '::TeRK::VideoStreamerServer'

        def ice_staticId():
            return '::TeRK::VideoStreamerServer'
        ice_staticId = staticmethod(ice_staticId)

        #
        # Operation signatures.
        #
        # def startVideoStream(self, current=None):
        # def stopVideoStream(self, current=None):
        # def startCamera(self, current=None):
        # def stopCamera(self, current=None):
        # def getFrame(self, frameNumber, current=None):

        def __str__(self):
            return IcePy.stringify(self, _M_TeRK._t_VideoStreamerServer)

        __repr__ = __str__

    _M_TeRK.VideoStreamerServerPrx = Ice.createTempClass()
    class VideoStreamerServerPrx(_M_TeRK.AbstractCommandControllerPrx):

        def startVideoStream(self, _ctx=None):
            return _M_TeRK.VideoStreamerServer._op_startVideoStream.invoke(self, ((), _ctx))

        def startVideoStream_async(self, _cb, _ctx=None):
            return _M_TeRK.VideoStreamerServer._op_startVideoStream.invokeAsync(self, (_cb, (), _ctx))

        def stopVideoStream(self, _ctx=None):
            return _M_TeRK.VideoStreamerServer._op_stopVideoStream.invoke(self, ((), _ctx))

        def stopVideoStream_async(self, _cb, _ctx=None):
            return _M_TeRK.VideoStreamerServer._op_stopVideoStream.invokeAsync(self, (_cb, (), _ctx))

        def startCamera(self, _ctx=None):
            return _M_TeRK.VideoStreamerServer._op_startCamera.invoke(self, ((), _ctx))

        def startCamera_async(self, _cb, _ctx=None):
            return _M_TeRK.VideoStreamerServer._op_startCamera.invokeAsync(self, (_cb, (), _ctx))

        def stopCamera(self, _ctx=None):
            return _M_TeRK.VideoStreamerServer._op_stopCamera.invoke(self, ((), _ctx))

        def stopCamera_async(self, _cb, _ctx=None):
            return _M_TeRK.VideoStreamerServer._op_stopCamera.invokeAsync(self, (_cb, (), _ctx))

        def getFrame(self, frameNumber, _ctx=None):
            return _M_TeRK.VideoStreamerServer._op_getFrame.invoke(self, ((frameNumber, ), _ctx))

        def getFrame_async(self, _cb, frameNumber, _ctx=None):
            return _M_TeRK.VideoStreamerServer._op_getFrame.invokeAsync(self, (_cb, (frameNumber, ), _ctx))

        def checkedCast(proxy, facetOrCtx=None, _ctx=None):
            return _M_TeRK.VideoStreamerServerPrx.ice_checkedCast(proxy, '::TeRK::VideoStreamerServer', facetOrCtx, _ctx)
        checkedCast = staticmethod(checkedCast)

        def uncheckedCast(proxy, facet=None):
            return _M_TeRK.VideoStreamerServerPrx.ice_uncheckedCast(proxy, facet)
        uncheckedCast = staticmethod(uncheckedCast)

    _M_TeRK._t_VideoStreamerServerPrx = IcePy.defineProxy('::TeRK::VideoStreamerServer', VideoStreamerServerPrx)

    _M_TeRK._t_VideoStreamerServer = IcePy.defineClass('::TeRK::VideoStreamerServer', VideoStreamerServer, (), True, None, (_M_TeRK._t_AbstractCommandController,), ())
    VideoStreamerServer.ice_type = _M_TeRK._t_VideoStreamerServer

    VideoStreamerServer._op_startVideoStream = IcePy.Operation('startVideoStream', Ice.OperationMode.Idempotent, Ice.OperationMode.Idempotent, False, (), (), (), None, (_M_TeRK._t_VideoException,))
    VideoStreamerServer._op_stopVideoStream = IcePy.Operation('stopVideoStream', Ice.OperationMode.Idempotent, Ice.OperationMode.Idempotent, False, (), (), (), None, (_M_TeRK._t_VideoException,))
    VideoStreamerServer._op_startCamera = IcePy.Operation('startCamera', Ice.OperationMode.Idempotent, Ice.OperationMode.Idempotent, False, (), (), (), IcePy._t_int, (_M_TeRK._t_VideoException,))
    VideoStreamerServer._op_stopCamera = IcePy.Operation('stopCamera', Ice.OperationMode.Idempotent, Ice.OperationMode.Idempotent, False, (), (), (), IcePy._t_int, (_M_TeRK._t_VideoException,))
    VideoStreamerServer._op_getFrame = IcePy.Operation('getFrame', Ice.OperationMode.Normal, Ice.OperationMode.Normal, False, (), (((), IcePy._t_int),), (), _M_TeRK._t_Image, (_M_TeRK._t_VideoException,))

    _M_TeRK.VideoStreamerServer = VideoStreamerServer
    del VideoStreamerServer

    _M_TeRK.VideoStreamerServerPrx = VideoStreamerServerPrx
    del VideoStreamerServerPrx

# End of module TeRK
